Skip to content

Remove the disconnect method of the RO class#97

Merged
Vitexus merged 3 commits into
Spoje-NET:mainfrom
petaak:master
Mar 23, 2026
Merged

Remove the disconnect method of the RO class#97
Vitexus merged 3 commits into
Spoje-NET:mainfrom
petaak:master

Conversation

@petaak

@petaak petaak commented Mar 22, 2026

Copy link
Copy Markdown
Contributor
  1. The @param annotation of the getColumnsFromAbraFlexi method: Filter conditions don't have a string key. For example here https://github.com/Spoje-NET/php-abraflexi/blob/main/src/AbraFlexi/RO.php#L2122, a combination of string and integer keys is used.

  2. Function curl_close() is deprecated since PHP 8.5, and it has no effect since PHP 8.0. In composer.json we require PHP version "^8.1", so I think we can remove the curl_close call.

  3. Check the external ID key parameter before searching it in the external keys array in the RO::getExternalID method. In PHP 8.5 passing null as the key parameter for array_key_exists() is deprecated.

Summary by CodeRabbit

  • Refactor

    • Simplified connection lifecycle and cleanup; reset behavior now re-initializes connection state without force-closing active handles.
  • Improvements

    • Broader support for numeric and string filter keys to allow more flexible queries.
    • Safer external-identifier lookup: explicit requests are used when present, otherwise a sensible default is returned.
  • Tests

    • Removed unused placeholder test stubs.

petaak added 2 commits March 22, 2026 18:54
Function curl_close() is deprecated since PHP 8.5, and it has no effect since
PHP 8.0.
@coderabbitai

coderabbitai Bot commented Mar 22, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Removed automatic cURL teardown by deleting __destruct() and disconnect() from src/AbraFlexi/RO.php; connectionReset() now calls only curlInit(). Broadened docblock key type for $conditions in getColumnsFromAbraFlexi(). Removed commented-out PHPUnit skeletons from tests.

Changes

Cohort / File(s) Summary
Resource management & API surface
src/AbraFlexi/RO.php
Deleted __destruct() and disconnect(): void; connectionReset() no longer calls disconnect() and now re-initializes via curlInit() only. Adjusted getExternalID($want = null) to use $want as array key only when $want !== null.
Docblock update
src/AbraFlexi/RO.php
Broadened docblock for getColumnsFromAbraFlexi(... $conditions = []) from array<string, mixed> to array<string|int, mixed>.
Test cleanup
tests/src/AbraFlexi/ROTest.php
Removed commented-out PHPUnit skeleton test stubs for disconnect() and connectionReset() (no executable test changes).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nudged the curl to sleep no more,
I wake it up with init's soft roar.
Keys widened wide for curious finds,
Old test husks swept — new clarity shines. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: removing the disconnect method and related cleanup from the RO class to address PHP 8.5 deprecations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use your project's PHP CodeSniffer (phpcs) configuration to improve the quality of PHP code reviews.

Add a phpcs.xml or phpcs.xml.dist file to your project to customize how CodeRabbit runs phpcs. See PHP CodeSniffer documentation for more details.

…al keys array

In PHP 8.5 passing null as the key parameter for array_key_exists() is deprecated.
@Vitexus Vitexus merged commit 5802be4 into Spoje-NET:main Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants